﻿using Guids;
using Microsoft.Extensions.DependencyInjection.Extensions;

namespace Microsoft.Extensions.DependencyInjection;

public static class GuidServiceCollectionExtensions
{
    public static IServiceCollection AddGuidGenerator(this IServiceCollection services, Action<SequentialGuidGeneratorOptions>? configureOptions = null)
    {
        if (configureOptions != null)
            services.Configure(configureOptions);

        services.TryAddTransient<IGuidGenerator, SequentialGuidGenerator>();

        return services;
    }
}
